﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Code4WP7SDK
{
    public class AppColorHelper
    {
        /// <summary>
        /// 获取系统背景色
        /// </summary>
        /// <returns></returns>
        public static Color GetPhoneBackGround()
        {
            return (Color)Application.Current.Resources["PhoneBackgroundColor"];
        }

        public static SolidColorBrush GetPhoneForeGround()
        {
            return (SolidColorBrush)Application.Current.Resources["PhoneForegroundBrush"];
        }

        /// <summary>
        /// 获得系统当前设置的颜色
        /// </summary>
        /// <returns></returns>
        public static SolidColorBrush GetAppAccentColor()
        {
            SolidColorBrush color = (SolidColorBrush)Application.Current.Resources["PhoneAccentBrush"];
            return color;
        }
        /// <summary>
        /// 判断是否是深主题
        /// </summary>
        /// <returns></returns>
        public static bool IsDarkTheme()
        {
            return Visibility.Visible == (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
        }
        /// <summary>
        /// 判断是否是浅主题
        /// </summary>
        /// <returns></returns>
        public static bool IsLightTheme()
        {
            return Visibility.Visible == (Visibility)Application.Current.Resources["PhoneLightThemeVisibility"];
        }
    }
}
